package tools;

import com.alibaba.fastjson.JSONObject;
import com.mongodb.MapReduceCommand;
import macaca.client.MacacaClient;
import org.apache.commons.io.FileUtils;
import org.openqa.selenium.OutputType;
import org.openqa.selenium.TakesScreenshot;
import org.testng.annotations.AfterClass;
import org.testng.annotations.Test;

import java.io.File;
import java.io.IOException;

import java.text.Format;
import java.text.SimpleDateFormat;
import java.util.Date;

public class Init_Macaca {

   MacacaClient driver=new MacacaClient();


  @Test
    public void Init() throws Exception {




        //props是react的一个属性值[props中文译为“管道”]
        JSONObject props=new JSONObject();

        //将browserName、platformName加入到props中

        //设置browserName为electron
       props.put("browserName","electron");
     // props.put("browserName","chrome");

        //设置platformName为desktop
        props.put("platformName","desktop");

        JSONObject desiredCapabilities=new JSONObject();


        //desiredCapabilities.put("host","192.168.1.9"); // custom remote host
      //  desiredCapabilities.put("port", 3456);        // custom remote port

        desiredCapabilities.put("desiredCapabilities",props);

        driver.initDriver(desiredCapabilities).maximize().get("https://www.baidu.com");



    }


    @AfterClass
    public void close() throws Exception {



        System.out.println("is ok");

        driver.sleep(5000);
        driver.quit();
    }







}
